# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=redsocks
pkgver=211.19b822e
pkgrel=2
pkgdesc='Transparent redirector of any TCP connection to proxy.'
groups=('blackarch' 'blackarch-proxy' 'blackarch-networking')
arch=('x86_64' 'aarch64')
url='https://github.com/darkk/redsocks'
license=('Apache')
depends=('libevent')
makedepends=('git')
source=("git+https://github.com/darkk/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" "$pkgname.conf.example" \
    "$pkgname.service"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

